package com.aspose.cells;

class zamu implements zahh {
   private zig a;
   private zat b;
   private zalw c;
   private int d;
   private int e = 0;
   private int f = 1;
   private Object g;
   private boolean h = false;

   zamu(zig var1, Object var2) {
      this.a = var1;
      this.g = var2;
      this.h();
   }

   private void h() {
      this.b = new zat(this.a, this.g, 5);
      this.c = new zalw(this.a, 7);
      zn var1 = this.a.ap();
      float var2;
      if (var1 == null) {
         var2 = 96.0F;
      } else {
         var2 = var1.g();
      }

      this.d = zbuk.c((double)(7.0F * var2 / 72.0F));
   }

   zat e() {
      return this.b;
   }

   public zafn a() {
      return this.b;
   }

   zalw f() {
      return this.c;
   }

   public zahf b() {
      return this.c;
   }

   public int c() {
      return this.d;
   }

   public void a(int var1) {
      this.d = var1;
   }

   public int d() {
      return this.f == 0 ? 1 : this.e;
   }

   public void b(int var1) {
      this.e = var1;
   }

   boolean g() {
      return this.d() != 1;
   }

   boolean a(zamu var1) throws Exception {
      if (this.g() == var1.g() && this.g()) {
         if (this.d() != var1.d()) {
            return false;
         }

         if (!this.e().a(var1.e())) {
            return false;
         }

         if (!this.f().a(var1.f())) {
            return false;
         }

         if (this.d() != var1.d()) {
            return false;
         }

         if (this.c() != var1.c()) {
            return false;
         }
      }

      return true;
   }

   void c(int var1) {
      if (this.d() == 0) {
         this.b(var1);
      }

   }

   void d(int var1) {
      if (this.d() == 0) {
         zn var2 = this.a.ap();
         float var3;
         if (var2 == null) {
            var3 = 96.0F;
         } else {
            var3 = var2.g();
         }

         this.d = zbuk.c((double)((float)var1 * var3 / 72.0F));
      }

   }

   void a(float var1, float var2) {
      if (this.e == 11) {
         if (this.e().g() && this.e().e().e() != null && this.e().e().e().a() != null) {
            com.aspose.cells.b.a.b.zs var3 = this.e().e().e().a().m();
            com.aspose.cells.b.a.b.a.ze var4 = new com.aspose.cells.b.a.b.a.ze();
            var1 -= (float)(var3.b() / 2);
            var2 -= (float)(var3.c() / 2);
            var4.b(new com.aspose.cells.b.a.b.zq(var1, var2, (float)var3.b(), (float)var3.c()));
            this.e().a(var4);
            this.c.a(var4);
         }
      } else {
         this.a(var1, var2, (float)this.c());
      }

   }

   void a(float var1, float var2, float var3) {
      if (this.d() != 1) {
         new com.aspose.cells.b.a.b.zq(var1 - var3 / 2.0F, var2 - var3 / 2.0F, var3, var3);
         zn var5 = this.a.ap();
         int var7 = zbuk.c((double)(var3 / 2.0F));
         com.aspose.cells.b.a.b.a.ze var10 = new com.aspose.cells.b.a.b.a.ze();
         int var8;
         int var9;
         switch(this.d()) {
         case 2:
            com.aspose.cells.b.a.b.zo[] var11 = new com.aspose.cells.b.a.b.zo[4];
            zbuk.a(var11);
            var11[0].a(var1 - (float)var7);
            var11[0].b(var2);
            var11[1].a(var1);
            var11[1].b(var2 - (float)var7);
            var11[2].a(var1 + (float)var7);
            var11[2].b(var2);
            var11[3].a(var1);
            var11[3].b(var2 + (float)var7);
            var10.b(var11);
            this.e().a(var10);
            this.c.a(var10);
            break;
         case 3:
            var1 -= (float)var7;
            var2 -= (float)var7;
            var10.b(new com.aspose.cells.b.a.b.zq(var1, var2, (float)(2 * var7), (float)(2 * var7)));
            this.e().a(var10);
            this.c.a(var10);
            break;
         case 4:
            com.aspose.cells.b.a.b.zo[] var12 = new com.aspose.cells.b.a.b.zo[3];
            zbuk.a(var12);
            var12[0].a(var1 - (float)var7);
            var12[0].b(var2 + (float)var7);
            var12[1].a(var1);
            var12[1].b(var2 - (float)var7);
            var12[2].a(var1 + (float)var7);
            var12[2].b(var2 + (float)var7);
            var10.b(var12);
            this.e().a(var10);
            this.c.a(var10);
            break;
         case 5:
            var1 -= (float)var7;
            var2 -= (float)var7;
            this.e().a(new com.aspose.cells.b.a.b.zq(var1, var2, (float)(var7 * 2), (float)(var7 * 2)));
            this.c.a(new com.aspose.cells.b.a.b.zo(var1, var2), new com.aspose.cells.b.a.b.zo(var1 + (float)(var7 * 2), var2 + (float)(var7 * 2)));
            this.c.a(new com.aspose.cells.b.a.b.zo(var1, var2 + (float)(var7 * 2)), new com.aspose.cells.b.a.b.zo(var1 + (float)(var7 * 2), var2));
            break;
         case 6:
            var1 -= (float)var7;
            var2 -= (float)var7;
            this.e().a(new com.aspose.cells.b.a.b.zq(var1, var2, (float)(var7 * 2), (float)(var7 * 2)));
            this.c.a(var1, var2, var1 + (float)(var7 * 2), var2 + (float)(var7 * 2));
            this.c.a(var1, var2 + (float)(var7 * 2), var1 + (float)(var7 * 2), var2);
            this.c.a(var1 + (float)var7, var2, var1 + (float)var7, var2 + (float)(var7 * 2));
            break;
         case 7:
            var1 -= (float)var7;
            var2 -= (float)var7;
            var10.a(var1, var2, (float)(var7 * 2), (float)(var7 * 2));
            this.e().a(var10);
            this.c.a(var10);
            break;
         case 8:
            var1 -= (float)var7;
            var2 -= (float)var7;
            this.e().a(new com.aspose.cells.b.a.b.zq(var1, var2, (float)(var7 * 2), (float)(var7 * 2)));
            this.c.a(var1, var2 + (float)var7, var1 + (float)(var7 * 2), var2 + (float)var7);
            this.c.a(var1 + (float)var7, var2, var1 + (float)var7, var2 + (float)(var7 * 2));
            break;
         case 9:
            var8 = zbuk.c((double)(var3 / 2.0F));
            var9 = zbuk.c((double)(var3 / 4.0F));
            if (var9 < 2) {
               var2 = (float)((int)((double)(var2 - (float)(var9 / 2)) + 0.5D));
            } else {
               var2 -= (float)(var9 / 2);
            }

            this.e().a(new com.aspose.cells.b.a.b.zq(var1, var2, (float)var8, (float)var9));
            this.c.a(new com.aspose.cells.b.a.b.zq(var1, var2, (float)var8, (float)var9));
            break;
         case 10:
            var8 = zbuk.c((double)var3);
            var9 = zbuk.c((double)(var3 / 4.0F));
            var1 -= (float)(var8 / 2);
            var2 -= (float)(var9 / 2);
            this.e().a(new com.aspose.cells.b.a.b.zq(var1, var2, (float)var8, (float)var9));
            this.c.a(new com.aspose.cells.b.a.b.zq(var1, var2, (float)var8, (float)var9));
            break;
         case 11:
            var1 -= (float)var7;
            var2 -= (float)var7;
            var10.b(new com.aspose.cells.b.a.b.zq(var1, var2, (float)(2 * var7), (float)(2 * var7)));
            this.e().a(var10);
            this.c.a(var10);
         }

      }
   }

   protected void finalize() throws Exception {
      this.a(false);
   }

   protected void a(boolean var1) {
      if (!this.h) {
         if (var1 && this.b != null) {
            this.b.l();
         }

         this.h = true;
      }

   }
}
